package com.baidu.thirdlib;

import android.app.Application;

import com.kvin.toolkit.utils.ThreadPoolUtils;
import com.sqm.baidumaplib.MapHelper;
import com.sqm.jpushlib.JPushUtils;
import com.umeng.analytics.MobclickAgent;
import com.umeng.socialize.Config;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;

/**
 * Created by imagine on 2015/11/10.
 */
public class BaseApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ThreadPoolUtils.init(3);

        MapHelper.initSDK(this);
//        SDKInitializer.initialize(this);

        JPushUtils.init(this);

        initUmeng();

        initShare();
    }

    /**
     * init share related
     */
    private void initShare() {
        UMShareAPI.init(this, "appkey");
        Config.DEBUG = true;
        PlatformConfig.setWeixin("wxId", "wxSecret");
        PlatformConfig.setQQZone("qqId", "qqSecret");
    }

    /**
     * initializing umeng config
     */
    private void initUmeng() {
        MobclickAgent.UMAnalyticsConfig mUmAnalyticsConfig = new MobclickAgent.UMAnalyticsConfig(this, "59113f8b45297d7a94001a18", "UMENG_CHANNEL");
        MobclickAgent.startWithConfigure(mUmAnalyticsConfig);
        MobclickAgent.setScenarioType(this, MobclickAgent.EScenarioType.E_UM_NORMAL);//normal model
        MobclickAgent.setDebugMode(true);
    }
}
